<#include "/layout/layout.ftl">
<#import "/layout/macro.ftl" as macro>
<#import "/layout/select.ftl" as my/>
<#assign css>
<style>
</style>
</#assign>
<#assign js>
<script>
	function del(id) {
		layer.confirm('确定取消?', {icon: 3, title: '取消后师傅信息将置为无效'}, function (index) {
			$.ajax({
				type: "POST",
				dataType: "json",
				url: "/masterdraw/delete/" + id,
				success: function (res) {
					layer.msg(res.message, {time: 2000}, function () {
						location.reload();
					});
				}
			});
		});
	}

	function agree(id) {
		layer.confirm('确定申请?', {icon: 3, title: ''}, function (index) {
			$.ajax({
				type: "POST",
				dataType: "json",
				url: "/masterdraw/agree/" + id,
				success: function (res) {
					layer.msg(res.message, {time: 2000}, function () {
						location.reload();
					});
				}
			});
		});
	}

	//tableId,queryId,conditionContainer
	//var userTable;
	var winId="userWin";
</script>
</#assign>
<@layout title="师傅提现申请" active="masterdraw">
<!-- Content Header (Page header) -->

<!-- Main content -->
<section class="content">
	<!-- Default box -->
	<div class="box box-primary">
		<div class="box-header">

			<form class="form-horizontal form-edit" method="post" action="/masterdraw/drawapply" id="form">
				<div class="form-group" style="margin-top:10px;">
					<div class="col-sm-2">
						<input  placeholder="师傅姓名" id="masterName" name="masterName" class="form-control" type="text" value="${masterDrawApplyReq.masterName!}" >
					</div>
					<div class="col-sm-2">
						<@my.select id="applyStatus" datas=getDict('WITHDRAWAL_STATUS')  value="${masterDrawApplyReq.applyStatus!}" defaultValue="请选择申请状态"/>
					</div>
<#--					<div class="col-sm-2">-->
<#--						<@my.select id="authStatus" datas=getDict('AUTH_STATUS')  value="${masterReq.authStatus!}" defaultValue="请选择认证状态"/>-->
<#--					</div>-->
<#--					<div class="col-sm-2">-->
<#--						<@my.select id="serviceType" datas=getDict('MASTER_SERVER')  value="${masterReq.servicType!}" defaultValue="请选择服务类型"/>-->
<#--					</div>-->
				</div>
				<div class="btn-group">
					<button type="submit" class="btn btn-primary" data-btn-type="search">查询</button>
					<button type="button" class="btn btn-default" data-btn-type="reset" onclick="javascript:$('#form')[0].reset();">重置</button>
				</div>
			</form>
<#--        <@shiro.hasPermission name="system:master:add">-->
<#--			<a class="btn btn-sm btn-success" href="/master/add">新增</a>-->
<#--        </@shiro.hasPermission>-->
		</div>
		<div class="box-body">
			<table class="table table-striped">
				<tr>
					<th></th>
					<th>师傅姓名</th>
					<th>银行名称</th>
					<th>银行卡号</th>
					<th>申请金额</th>
					<th>手续费</th>
					<th>实际金额</th>
					<th>申请时间</th>
					<th>申请状态</th>
<#--					<th>处理人</th>-->
					<th>备注</th>
					<th>操作</th>
				</tr>
                <#list pageInfo.list as item>
                <tr>
					<td >${item.id!}</td>
					<td >${item.masterName!}</td>
					<td >${item.bankName!}</td>
					<td >${item.bankCardNumber!}</td>
					<td >${item.applyAmount!}</td>
					<td >${item.brokerage?string("0.##")!}</td>
					<td >${item.realityAmount?string("0.##")!}</td>
					<td >${item.createDt?string('yyyy-MM-dd')!}</td>
					<td >${convert('WITHDRAWAL_STATUS',item.applyStatus)!}</td>
<#--					<td >${item.procesName!}</td>-->
					<td >${item.remark!}</td>
					<td >
					<#if item.applyStatus = '1'  && item.status='1'>

						<@shiro.hasPermission name="system:masterdraw:refused">
							<button class="btn btn-sm btn-danger" onclick="del('${item.id}')">拒绝</button>
						</@shiro.hasPermission>
						<@shiro.hasPermission name="system:masterdraw:agree">
							<button class="btn btn-sm btn-success" onclick="agree('${item.id}')">同意</button>
						</@shiro.hasPermission>
						<@shiro.hasPermission name="system:masterdraw:blockAccmout">
							<a class="btn btn-sm btn-primary" href="/masterdraw/blockAccmout/${item.id}" data-btn-type="edit">冻结金额</a>
						</@shiro.hasPermission>
					</#if>
					</td>
				</tr>
                </#list>
			</table>
		</div>
		<!-- /.box-body -->
		<div class="box-footer clearfix">
            <@macro.page pageInfo=pageInfo url="/masterdraw/drawapply?" />
		</div>
	</div>
	<!-- /.box -->

</section>
<!-- /.content -->
</@layout>
